package com.weather.business.service.impl;

import java.util.List;
import com.weather.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.weather.business.mapper.NmCityMapper;
import com.weather.business.domain.NmCity;
import com.weather.business.service.INmCityService;

/**
 * 城市Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-15
 */
@Service
public class NmCityServiceImpl implements INmCityService 
{
    @Autowired
    private NmCityMapper nmCityMapper;

    /**
     * 查询城市
     * 
     * @param cityid 城市主键
     * @return 城市
     */
    @Override
    public NmCity selectNmCityByCityid(String cityid)
    {
        return nmCityMapper.selectNmCityByCityid(cityid);
    }

    /**
     * 查询城市列表
     * 
     * @param nmCity 城市
     * @return 城市
     */
    @Override
    public List<NmCity> selectNmCityList(NmCity nmCity)
    {
        return nmCityMapper.selectNmCityList(nmCity);
    }

    /**
     * 新增城市
     * 
     * @param nmCity 城市
     * @return 结果
     */
    @Override
    public int insertNmCity(NmCity nmCity)
    {
        nmCity.setCreateTime(DateUtils.getNowDate());
        return nmCityMapper.insertNmCity(nmCity);
    }

    /**
     * 修改城市
     * 
     * @param nmCity 城市
     * @return 结果
     */
    @Override
    public int updateNmCity(NmCity nmCity)
    {
        nmCity.setUpdateTime(DateUtils.getNowDate());
        return nmCityMapper.updateNmCity(nmCity);
    }

    /**
     * 批量删除城市
     * 
     * @param cityids 需要删除的城市主键
     * @return 结果
     */
    @Override
    public int deleteNmCityByCityids(String[] cityids)
    {
        return nmCityMapper.deleteNmCityByCityids(cityids);
    }

    /**
     * 删除城市信息
     * 
     * @param cityid 城市主键
     * @return 结果
     */
    @Override
    public int deleteNmCityByCityid(String cityid)
    {
        return nmCityMapper.deleteNmCityByCityid(cityid);
    }
}
